package com.example.Controller.Folder;

import com.example.Entity.Dto.PageParmar;
import com.example.Entity.Vo.APIResult;
import com.example.IService.IFolderService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/API/Folder")
public class FolderController {
    @Resource
    IFolderService iFolderService;

    /**
     * 获取用户的文件夹
     * @param pageParmar 分页
     * @return APIResult
     */
    @PostMapping("/GetUserFolder")
    public APIResult GetUserFolder(@RequestBody PageParmar pageParmar){
        return iFolderService.GetUserFolder(pageParmar);
    }

    /**
     * 添加文件夹
     * @param name 文件夹名称
     * @return APIResult
     */
    @GetMapping("/AddFolder")
    public APIResult AddFolder(String name){
        return iFolderService.AddFolder(name);
    }

    /**
     * 获取用户所有的文件夹名
     * @return APIResult
     */
    @GetMapping("/GetFolderNameAll")
    public APIResult GetFolderNameAll(){
        return iFolderService.GetFolderNameAll();
    }
}
